﻿using System;
using System.Drawing;

namespace CashCrusaderScript
{
    internal static class Colour
    {
        public static bool IsDifferent(Color c1, Color c2)
        {
            return Math.Abs(c1.R - c2.R) > 64 || Math.Abs(c1.G - c2.G) > 64 || Math.Abs(c1.B - c2.B) > 64;
        }

        public static Color AverageColor(Color c1, Color c2)
        {
            int Red = (int)(c1.R + c2.R) / 2;
            int Blue = (int)(c1.B + c2.B) / 2;
            int Green = (int)(c1.G + c2.G) / 2;
            Color ReturnColor = Color.FromArgb(Red, Blue, Green);
            return ReturnColor;
        }

        public static bool IsDark(Color c)
        {
            bool Red = (c.R) < 80;
            bool Blue = (c.B) < 80;
            bool Green = (c.G) < 80;

            return (Red && Green) || (Red && Blue) || (Blue && Green);
        }

        public static bool IsBright(Color c)
        {
            bool Red = (c.R) > 204;
            bool Blue = (c.B) > 204;
            bool Green = (c.G) > 204;

            return (Red && Green) || (Red && Blue) || (Blue && Green);
        }

        public static bool IsBG(Color c)
        {
            return (c.R > 204 && c.B > 204 && c.G > 204);
        }
    }
}
